package com.xinxin.intelligenceexam.fragment.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.xinxin.intelligenceexam.domain.Question;
import com.xinxin.intelligenceexam.fragment.ExamPagerFragment;

import java.util.List;

/**
 * User: Tianxin
 * Date: 2016-11-12
 * Time: 15:22
 */

public class ExamPagerFragmentPagerAdapter extends FragmentPagerAdapter {
    List<Question> mQuestionList;
    List<ExamPagerFragment> mExamPagerFragmentList;

    public ExamPagerFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    public ExamPagerFragmentPagerAdapter(FragmentManager fm, List<ExamPagerFragment> fragmentList) {
        super(fm);
        mExamPagerFragmentList = fragmentList;
        notifyDataSetChanged();
    }

    @Override
    public Fragment getItem(int position) {
        return mExamPagerFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mExamPagerFragmentList.size();
    }

    @Override
    public long getItemId(int position) {
        return position;
    }
}
